home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Guided Tour of Multimedia (Second Edition)
/
The Guided Tour of Multimedia (Second Edition).iso
/
trials
/
director
/
evalcopy
/
director.z
/
NAVIGATR.DIR
/
00473_Field_473.txt
< prev
next >
Wrap
Text File
|
1994-06-14
|
2KB
|
84 lines
MECH , 77
--=================================================================
-- This handler reads a stream of data, from a file
-- and converts it into an part number. With the part number
-- it can then create a part of that type. It then places the
-- part on the peg board using the coorindates also read
-- from the file.
on readToStage me,thisFile
-- get numb of parts
put thisFile(mReadChar) into myChar
put NumToChar(myChar) into myChar
repeat while myChar <> "="
put thisFile(mReadChar) into myChar
put NumToChar(myChar) into myChar
end repeat
put thisFile(mReadChar) into myChar
put NumToChar(myChar) into myChar
put "" into pnStr
repeat while myChar <> RETURN
set pnStr = pnStr&myChar
put thisFile(mReadChar) into myChar
put NumToChar(myChar) into myChar
end repeat
put thisFile(mReadChar) into myChar
put NumToChar(myChar) into myChar
put value(pnStr) into index
-- get the parts
set count = 1
repeat while count < index
-- get the ID , used as an ID for the type of part
put "" into pnStr
repeat while (myChar <> ",")
set pnStr = pnStr&myChar
put thisFile(mReadChar) into myChar
put NumToChar(myChar) into myChar
end repeat
put value(pnStr) into thisID
put thisFile(mReadChar) into myChar
put NumToChar(myChar) into myChar
-- get locH and locV
put "" into pnStr
repeat while (myChar <> ",")
set pnStr = pnStr&myChar
put thisFile(mReadChar) into myChar
put NumToChar(myChar) into myChar
end repeat
put value(pnStr) into thisLocH
put thisFile(mReadChar) into myChar
put NumToChar(myChar) into myChar
put "" into pnStr
repeat while (myChar <> RETURN)
set pnStr = pnStr&myChar
put thisFile(mReadChar) into myChar
put NumToChar(myChar) into myChar
end repeat
put value(pnStr) into thisLocV
put thisFile(mReadChar) into myChar
put NumToChar(myChar) into myChar
-- create the part
set partNum = mPartIDToPartn (me,thisID)
set thisSprite = mNewPart (me,partNum)
if thisSprite then
--set thisSprite = mGetSprite (thisPart)
set the locH of sprite thisSprite = thisLocH
set the locV of sprite thisSprite = thisLocV
end if
set count = count + 1
end repeat
end readToStage